# 执行测试用例用的总文件
import datetime
import unittest
# 导入生成html测试报告的包
from HTMLTestRunner import HTMLTestRunner

if __name__ == '__main__':
    # 加载测试用例，得到测试用例集
    suite = unittest.TestLoader().discover('./test', 'yibiaopan_test.py')
    t_str = datetime.datetime.now().strftime("%Y_%d_%m_%H_%M_%S")
    res_file = './test_result/'+t_str+'.html'
    with open(res_file, 'wb') as f:
        runner = HTMLTestRunner(f)
        runner.run(suite)